package com.example.sneakerappserver.repository;

import com.example.sneakerappserver.pojo.Goods;
import com.example.sneakerappserver.pojo.User;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface GoodsRepository extends CrudRepository<Goods,Long> {
    @Query(value = "SELECT * FROM tb_goods WHERE goods_id=:goodsId",nativeQuery = true)
    Goods findByGoodsId(Long goodsId);

    @Query(value = "SELECT * FROM tb_goods ", nativeQuery = true)
    List<Goods> findAll();
}
